﻿using System;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiGeometry_Internal : OdGiGeometry
	{
		public OdGiGeometry_Internal(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
		{
		}

		public override OdGeMatrix3d getModelToWorldTransform()
		{
			IntPtr cPtr = GlobalsPINVOKE.OdGiGeometry_getModelToWorldTransform(OdGiGeometry.getCPtr(this));
			OdGeMatrix3d result = new OdGeMatrix3d(cPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public override OdGeMatrix3d getWorldToModelTransform()
		{
			IntPtr cPtr = GlobalsPINVOKE.OdGiGeometry_getWorldToModelTransform(OdGiGeometry.getCPtr(this));
			OdGeMatrix3d result = new OdGeMatrix3d(cPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public override void pushModelTransform(OdGeMatrix3d xfm)
		{
			GlobalsPINVOKE.OdGiGeometry_pushModelTransform__SWIG_1(OdGiGeometry.getCPtr(this), OdGeMatrix3d.getCPtr(xfm));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void pushModelTransform(OdGeVector3d normal)
		{
			GlobalsPINVOKE.OdGiGeometry_pushModelTransform__SWIG_0(OdGiGeometry.getCPtr(this), OdGeVector3d.getCPtr(normal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void popModelTransform()
		{
			GlobalsPINVOKE.OdGiGeometry_popModelTransform(OdGiGeometry.getCPtr(this));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circle(OdGePoint3d center, double radius, OdGeVector3d normal)
		{
			GlobalsPINVOKE.OdGiGeometry_circle__SWIG_0(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circle(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			GlobalsPINVOKE.OdGiGeometry_circle__SWIG_1(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle)
		{
			GlobalsPINVOKE.OdGiGeometry_circularArc__SWIG_1(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(startVector), sweepAngle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle, OdGiArcType arcType)
		{
			GlobalsPINVOKE.OdGiGeometry_circularArc__SWIG_0(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(startVector), sweepAngle, (int)arcType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			GlobalsPINVOKE.OdGiGeometry_circularArc__SWIG_3(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint, OdGiArcType arcType)
		{
			GlobalsPINVOKE.OdGiGeometry_circularArc__SWIG_2(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint), (int)arcType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal, IntPtr baseSubEntMarker)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_polyline__SWIG_0(OdGiGeometry.getCPtr(this), intPtr, OdGeVector3d.getCPtr(pNormal), baseSubEntMarker);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_polyline__SWIG_1(OdGiGeometry.getCPtr(this), intPtr, OdGeVector3d.getCPtr(pNormal));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void polyline(OdGePoint3d[] numVertices)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_polyline__SWIG_2(OdGiGeometry.getCPtr(this), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void polygon(OdGePoint3d[] numVertices)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_polygon(OdGiGeometry.getCPtr(this), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void pline(OdGiPolyline polyline)
		{
			GlobalsPINVOKE.OdGiGeometry_pline__SWIG_2(OdGiGeometry.getCPtr(this), OdGiPolyline.getCPtr(polyline));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void pline(OdGiPolyline polyline, uint fromIndex)
		{
			GlobalsPINVOKE.OdGiGeometry_pline__SWIG_1(OdGiGeometry.getCPtr(this), OdGiPolyline.getCPtr(polyline), fromIndex);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void pline(OdGiPolyline polyline, uint fromIndex, uint numSegs)
		{
			GlobalsPINVOKE.OdGiGeometry_pline__SWIG_0(OdGiGeometry.getCPtr(this), OdGiPolyline.getCPtr(polyline), fromIndex, numSegs);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void mesh(MeshData numRows)
		{
			IntPtr intPtr = Helpers.MarshalMeshData(numRows);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_mesh(OdGiGeometry.getCPtr(this), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void shell(ShellData numVertices)
		{
			IntPtr intPtr = Helpers.MarshalShellData(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_shell(OdGiGeometry.getCPtr(this), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public override void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, double height, double width, double oblique, string msg)
		{
			GlobalsPINVOKE.OdGiGeometry_text__SWIG_0(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(position), OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(direction), height, width, oblique, msg);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, string msg, bool raw, OdGiTextStyle pTextStyle)
		{
			GlobalsPINVOKE.OdGiGeometry_text__SWIG_1(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(position), OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(direction), msg, raw, OdGiTextStyle.getCPtr(pTextStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void xline(OdGePoint3d firstPoint, OdGePoint3d secondPoint)
		{
			GlobalsPINVOKE.OdGiGeometry_xline(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void ray(OdGePoint3d basePoint, OdGePoint3d throughPoint)
		{
			GlobalsPINVOKE.OdGiGeometry_ray(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(basePoint), OdGePoint3d.getCPtr(throughPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void nurbs(OdGeNurbCurve3d nurbsCurve)
		{
			GlobalsPINVOKE.OdGiGeometry_nurbs(OdGiGeometry.getCPtr(this), OdGeNurbCurve3d.getCPtr(nurbsCurve));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides, OdGiArcType arcType)
		{
			IntPtr intPtr = Helpers.MarshalPointPair(endPointsOverrides);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_ellipArc__SWIG_0(OdGiGeometry.getCPtr(this), OdGeEllipArc3d.getCPtr(ellipArc), intPtr, (int)arcType);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != IntPtr.Zero)
				{
					Marshal.FreeCoTaskMem(intPtr);
				}
			}
		}

		public override void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides)
		{
			IntPtr intPtr = Helpers.MarshalPointPair(endPointsOverrides);
			try
			{
				GlobalsPINVOKE.OdGiGeometry_ellipArc__SWIG_1(OdGiGeometry.getCPtr(this), OdGeEllipArc3d.getCPtr(ellipArc), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != IntPtr.Zero)
				{
					Marshal.FreeCoTaskMem(intPtr);
				}
			}
		}

		public override void ellipArc(OdGeEllipArc3d ellipArc)
		{
			GlobalsPINVOKE.OdGiGeometry_ellipArc__SWIG_2(OdGiGeometry.getCPtr(this), OdGeEllipArc3d.getCPtr(ellipArc));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void draw(OdGiDrawable pDrawable)
		{
			GlobalsPINVOKE.OdGiGeometry_draw(OdGiGeometry.getCPtr(this), OdGiDrawable.getCPtr(pDrawable));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void pushClipBoundary(OdGiClipBoundary pBoundary)
		{
			GlobalsPINVOKE.OdGiGeometry_pushClipBoundary__SWIG_0(OdGiGeometry.getCPtr(this), OdGiClipBoundary.getCPtr(pBoundary));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void popClipBoundary()
		{
			GlobalsPINVOKE.OdGiGeometry_popClipBoundary(OdGiGeometry.getCPtr(this));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void worldLine(OdGePoint3d points)
		{
			GlobalsPINVOKE.OdGiGeometry_worldLine(OdGiGeometry.getCPtr(this), OdGePoint3d.getCPtr(points));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public override void pushClipBoundary(OdGiClipBoundary pBoundary, OdGiAbstractClipBoundary pClipInfo)
		{
			GlobalsPINVOKE.OdGiGeometry_pushClipBoundary__SWIG_1(OdGiGeometry.getCPtr(this), OdGiClipBoundary.getCPtr(pBoundary), OdGiAbstractClipBoundary.getCPtr(pClipInfo));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}
	}
}
